package com.rose.datax.dataxadmin.action;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@Slf4j
public class IndexAction {

    @RequestMapping("/")
    public String index(){
        return "index";
    }

    @RequestMapping("/welcome.html")
    public String welcome(){
        return "welcome";
    }

    @RequestMapping("/databases.html")
    public String databases(){
        return "databases";
    }

    @RequestMapping("/tasks.html")
    public String tasks(){
        return "tasks";
    }

    @RequestMapping("/migration_list.html")
    public String migrationList(Long taskId, ModelMap modelMap){
        log.info("get taskId {}", taskId);
        modelMap.addAttribute("taskId", taskId);
        return "migration_list";
    }

    @RequestMapping("/data_mask.html")
    public String dataMask(Long taskId, ModelMap modelMap){
        log.info("get taskId {}", taskId);
        modelMap.addAttribute("taskId", taskId);
        return "data_mask";
    }



}
